<?php
/**
 * Created by PhpStorm.
 * User: jacob
 * Date: 18-10-12
 * Time: 下午3:41
 */
namespace Common;

abstract class Api{
  public function process(Request $request, Response $response){
    if ($this->before($request, $response)){
      $this->run($request, $response);
      $this->after($request, $response);
    }
  }
  abstract protected function before(Request $request, Response $response):bool ;
  abstract protected function after(Request $request, Response $response);
  abstract protected function run(Request $request, Response $response);
}